Add cap server client#2049
Conversation
|
👋 ilija42, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
There was a problem hiding this comment.
Pull request overview
This PR introduces new Stellar CRE chain-capability bindings (generated protobuf + server wrapper) and supporting proto/domain conversion + validation helpers, and extends the Stellar domain client interface.
Changes:
- Added
SimulateTransactionto thepkg/types/chains/stellar.Clientinterface. - Added generated Stellar chain-capability proto/server code under
pkg/capabilities/v2/chain-capabilities/stellar/. - Added proto helper conversions/validators (with tests) for Stellar chain-capability messages; bumped
chainlink-protos/cre/godependency.
Reviewed changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/types/chains/stellar/stellar.go | Extends Stellar domain client interface with SimulateTransaction. |
| pkg/capabilities/v2/chain-capabilities/stellar/server/client_server_gen.go | Generated capability server wrapper for Stellar methods (GetLatestLedger/ReadContract/WriteReport). |
| pkg/capabilities/v2/chain-capabilities/stellar/proto_helpers.go | Adds proto↔domain conversion helpers and request validation. |
| pkg/capabilities/v2/chain-capabilities/stellar/proto_helpers_test.go | Adds unit tests for conversions and validators. |
| pkg/capabilities/v2/chain-capabilities/stellar/generate.go | Adds go:generate entry for Stellar capability codegen. |
| pkg/capabilities/v2/chain-capabilities/stellar/client.pb.go | Generated protobuf bindings for Stellar CRE client capability. |
| go.mod | Bumps github.com/smartcontractkit/chainlink-protos/cre/go version. |
| go.sum | Updates checksums for the bumped dependency version. |
Files not reviewed (2)
- pkg/capabilities/v2/chain-capabilities/stellar/client.pb.go: Language not supported
- pkg/capabilities/v2/chain-capabilities/stellar/server/client_server_gen.go: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Both methods map 1:1 to the Stellar RPC API. | ||
| type Client interface { | ||
| SimulateTransaction(context.Context, string, []byte) ([]byte, error) |
| } | ||
|
|
||
| // ConvertGetLatestLedgerResponseToProto converts the domain GetLatestLedgerResponse to a proto. | ||
| // Hash must be a valid lowercase hex string; XDR fields must be valid standard base64. |
| // domain type. Hash is returned as lowercase hex; XDR fields are returned as standard base64. | ||
| func ConvertGetLatestLedgerResponseFromProto(p *GetLatestLedgerResponse) (stellartypes.GetLatestLedgerResponse, error) { | ||
| if p == nil { | ||
| return stellartypes.GetLatestLedgerResponse{}, errors.New("GetLatestLedgerResponse is nil") |
| // ValidateReadContractRequest checks that required fields are present. | ||
| func ValidateReadContractRequest(req *ReadContractRequest) error { | ||
| if req == nil { | ||
| return errors.New("ReadContractRequest is nil") |
c14196d to
0c96357
Compare
|
Requires
Supports